---
title: Agent
description: Create powerful AI agents using any LLM provider
---

import { Callout } from 'fumadocs-ui/components/callout'
import { Step, Steps } from 'fumadocs-ui/components/steps'
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
import { ThemeImage } from '@/components/ui/theme-image'

The Agent block is a fundamental component in Sim Studio that allows you to create powerful AI agents using various LLM providers. These agents can process inputs based on customizable system prompts and utilize integrated tools to enhance their capabilities.

<ThemeImage
  lightSrc="/static/light/agent-light.png"
  darkSrc="/static/dark/agent-dark.png"
  alt="Agent Block"
  width={300}
  height={175}
/>

<Callout type="info">
  Agent blocks serve as interfaces to Large Language Models, enabling your workflow to leverage
  state-of-the-art AI capabilities.
</Callout>

## Overview

The Agent block serves as an interface to Large Language Models (LLMs), enabling you to create agents that can:

<Steps>
  <Step>
    <strong>Respond to user inputs</strong>: Generate natural language responses based on provided
    inputs
  </Step>
  <Step>
    <strong>Follow instructions</strong>: Adhere to specific instructions defined in the system
    prompt
  </Step>
  <Step>
    <strong>Use specialized tools</strong>: Interact with integrated tools to extend capabilities
  </Step>
  <Step>
    <strong>Structure output</strong>: Generate responses in structured formats when needed
  </Step>
</Steps>

## Configuration Options

### System Prompt

The system prompt defines the agent's behavior, capabilities, and limitations. It's the primary way to instruct the agent on how to respond to inputs.

```markdown
You are a helpful assistant that specializes in financial analysis.
Always provide clear explanations and cite sources when possible.
When responding to questions about investments, include risk disclaimers.
```

### User Prompt

The user prompt or context is the specific input or question that the agent should respond to. This can be:

- Directly provided in the block configuration
- Connected from another block's output
- Dynamically generated during workflow execution

### Model Selection

Choose from a variety of LLM providers:

- OpenAI (GPT-4o, o1, o3, o4-mini)
- Anthropic (Claude 3.7 Sonnet)
- Google (Gemini 2.5 Pro, Gemini 2.0 Flash)
- Groq, Cerebras
- Ollama Local Models
- And more

### Temperature

Control the creativity and randomness of responses:

<Tabs items={['Low (0-0.3)', 'Medium (0.3-0.7)', 'High (0.7-2.0)']}>
  <Tab>
    <p>
      More deterministic, focused responses. Best for factual tasks, customer support, and
      situations where accuracy is critical.
    </p>
  </Tab>
  <Tab>
    <p>
      Balanced creativity and focus. Suitable for general purpose applications that require both
      accuracy and some creativity.
    </p>
  </Tab>
  <Tab>
    <p>
      More creative, varied responses. Ideal for creative writing, brainstorming, and generating
      diverse ideas.
    </p>
  </Tab>
</Tabs>

<p className="mt-4 text-sm text-gray-600 dark:text-gray-400">
  The temperature range (0-1 or 0-2) varies depending on the selected model.
</p>

### API Key

Your API key for the selected LLM provider. This is securely stored and used for authentication.

### Tools

Integrate specialized tools to enhance the agent's capabilities. You can add tools to your agent by:

1. Clicking the Tools section in the Agent configuration
2. Selecting from the tools dropdown menu
3. Choosing an existing tool or creating a new one

<ThemeImage
  lightSrc="/static/light/tooldropdown-light.png"
  darkSrc="/static/dark/tooldropdown-dark.png"
  alt="Tools Dropdown"
  width={150}
  height={125}
/>

Available tools include:

- **Confluence**: Access and query Confluence knowledge bases
- **Evaluator**: Use evaluation metrics to assess content
- **GitHub**: Interact with GitHub repositories and issues
- **Gmail**: Process and respond to emails
- **Firecrawl**: Web search and content retrieval
- And many, many more pre-built integrations

You can also create custom tools to meet specific requirements for your agent's capabilities.

<Callout type="info">
  Tools significantly expand what your agent can do, allowing it to access external systems,
  retrieve information, and take actions beyond simple text generation.
</Callout>

### Response Format

Define a structured format for the agent's response when needed, using JSON or other formats.

## Inputs and Outputs

<Tabs items={['Inputs', 'Outputs']}>
  <Tab>
    <ul className="list-disc space-y-2 pl-6">
      <li>
        <strong>User Prompt</strong>: The user's query or context for the agent
      </li>
      <li>
        <strong>System Prompt</strong>: Instructions for the agent (optional)
      </li>
      <li>
        <strong>Tools</strong>: Optional tool connections that the agent can use
      </li>
    </ul>
  </Tab>
  <Tab>
    <ul className="list-disc space-y-2 pl-6">
      <li>
        <strong>Content</strong>: The agent's response text
      </li>
      <li>
        <strong>Model</strong>: The model used for generation
      </li>
      <li>
        <strong>Tokens</strong>: Usage statistics (prompt, completion, total)
      </li>
      <li>
        <strong>Tool Calls</strong>: Details of any tools used during processing
      </li>
      <li>
        <strong>Cost</strong>: Cost of the response
      </li>
      <li>
        <strong>Usage</strong>: Usage statistics (prompt, completion, total)
      </li>
    </ul>
  </Tab>
</Tabs>

## Example Usage

Here's an example of how an Agent block might be configured for a customer support workflow:

```yaml
# Example Agent Configuration
systemPrompt: |
  You are a customer support agent for TechCorp.
  Always maintain a professional, friendly tone.
  If you don't know an answer, direct the customer to email support@techcorp.com.
  Never make up information about products or policies.

model: OpenAI/gpt-4
temperature: 0.2
tools:
  - ProductDatabase
  - OrderHistory
  - SupportTicketCreator
```

## Best Practices

- **Be specific in system prompts**: Clearly define the agent's role, tone, and limitations. The more specific your instructions are, the better the agent will be able to fulfill its intended purpose.
- **Choose the right temperature setting**: Use lower temperature settings (0-0.3) when accuracy is important, or increase temperature (0.7-2.0) for more creative or varied responses
- **Combine with Evaluator blocks**: Use Evaluator blocks to assess agent responses and ensure quality. This allows you to create feedback loops and implement quality control measures.
- **Leverage tools effectively**: Integrate tools that complement the agent's purpose and enhance its capabilities. Be selective about which tools you provide to avoid overwhelming the agent.
